﻿using MyMeeting.Common;
using MyMeeting.Extensions;
using Prism.Mvvm;
using Prism.Services.Dialogs;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyMeeting.ViewModels.Dialogs
{
    public class ShareScreenViewModel : BindableBase, IDialogAware
    {
        public string Title => "共享屏幕";

        public event Action<IDialogResult> RequestClose;

        public ShengGEngine MeetEngine { get => PrismManager.MeetEngine; }

        public bool CanCloseDialog()
        {
            return true;
        }

        public void OnDialogClosed()
        {
           
        }

        public void OnDialogOpened(IDialogParameters parameters)
        {
            //var user = PrismManager.CurrentUser;
            //if(user.isShareScreen==false)
            //{
            //    var ret = MeetEngine.StartShareScreen();

            //    if (ret == 0) user.isShareScreen = true;
            //}
            //else
            //{
            //  var ret=  MeetEngine.Rtc.StopScreenCapture();
            //    if (ret == 0)
            //    {
            //        user.isShareScreen = false;
            //    }
            //}
        }
    }
}
